package com.zib.bilibili.view.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.RadioGroup;
import android.widget.Toast;

import com.zib.bilibili.R;
import com.zib.bilibili.base.BaseFragment;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Saro on 2016/7/5.
 */
public class SubareaFragment extends BaseFragment implements RadioGroup.OnCheckedChangeListener {
    @Bind(R.id.radioGroup_subarea_lineone)
    RadioGroup radioGroupSubareaLineone;
    @Bind(R.id.radioGroup_subarea_linetwo)
    RadioGroup radioGroupSubareaLinetwo;
    @Bind(R.id.radioGroup_subarea_linethree)
    RadioGroup radioGroupSubareaLinethree;
    @Bind(R.id.radioGroup_subarea_linefour)
    RadioGroup radioGroupSubareaLinefour;
    @Bind(R.id.radioGroup_subarea_linefive)
    RadioGroup radioGroupSubareaLinefive;

    public static SubareaFragment newInstance() {
        SubareaFragment fragment = new SubareaFragment();
        return fragment;
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_subarea_main;
    }

    @Override
    public void initView() {
        radioGroupSubareaLineone.setOnCheckedChangeListener(this);
        radioGroupSubareaLinetwo.setOnCheckedChangeListener(this);
        radioGroupSubareaLinethree.setOnCheckedChangeListener(this);
        radioGroupSubareaLinefour.setOnCheckedChangeListener(this);
        radioGroupSubareaLinefive.setOnCheckedChangeListener(this);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    @Override
    public void onCheckedChanged(RadioGroup group, int checkedId) {
        switch (checkedId) {
            case R.id.radioButton_one_1:
                Toast.makeText(getActivity(), "1", Toast.LENGTH_SHORT).show();
                break;
            case R.id.radioButton_one_2:
                Toast.makeText(getActivity(), "2", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_one_3:
                Toast.makeText(getActivity(), "3", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_two_1:
                Toast.makeText(getActivity(), "4", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_two_2:
                Toast.makeText(getActivity(), "5", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_two_3:
                Toast.makeText(getActivity(), "6", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_three_1:
                Toast.makeText(getActivity(), "7", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_three_2:
                Toast.makeText(getActivity(), "8", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_three_3:
                Toast.makeText(getActivity(), "9", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_four_1:
                Toast.makeText(getActivity(), "10", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_four_2:
                Toast.makeText(getActivity(), "11", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_four_3:
                Toast.makeText(getActivity(), "12", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_five_1:
                Toast.makeText(getActivity(), "13", Toast.LENGTH_SHORT).show();

                break;
            case R.id.radioButton_five_2:
                Toast.makeText(getActivity(), "14", Toast.LENGTH_SHORT).show();

                break;
        }
    }
}
